package morning.cat.study.springboot.hotdeploy.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

	@RequestMapping(value = "/hi", method = { RequestMethod.GET, RequestMethod.POST })
	public String method1(@RequestParam(value = "name", defaultValue = "morningcat") String name) {
		return "Hello " + name;
	}

	@GetMapping(value = "/hi/{userName}")
	public String method2(@PathVariable String userName) {
		return "Hello " + userName;
	}

}
